//声明： 该文件需要 swiper，jqueryui,common,toast,jquery
require(["config"],function(config){
	require(["jquery.ui","com","jquery","zepto","sw","toast","cookie"],function(jqui,com,jq,sep,sw,t,cookie){
	//top
	$(".top-myfifth").hover(function(){
		$(".myfifth").css("display","block")
	},function(){
		$(".myfifth").css("display","none")
	});
	$(".pdownload").hover(function(){
		$(".phonedd").css("background-position-y","-411px")
		$(".top-weixin").css("display","block")
	},function(){
		$(".phonedd").css("background-position-y","-376px")
		$(".top-weixin").css("display","none")
	})
	//banner轮播开始
	 var mySwiper = new Swiper ('.swiper-container', {
    direction: 'horizontal',
    autoplay : 3000,
    grabCursor : true,
    loop: true,
    pagination : '.swiper-pagination',
    paginationClickable :true,
   	autoplayDisableOnInteraction: false,
    // 如果需要分页器
    pagination: '.swiper-pagination',
    
    // 如果需要前进后退按钮
    nextButton: '.swiper-button-next',
    prevButton: '.swiper-button-prev',
  })        
 
	//banner轮播结束
	//list-top  list-animate
	$(".list-brandship-middle li").hover(function(){
		$(this).find(".list-animate").stop().animate({"top":"175px"},200);
	},function(){
		$(this).find(".list-animate").stop().animate({"top":"300px"})
	})
	//hotstore-animate
	$(".hoststore-main-ul li").hover(function(){
		$(this).find(".host-cover").stop().css("display","block");
		$(this).stop().css("border-color","#000000");
	},function(){
		$(this).find(".host-cover").stop().css("display","none");
		$(this).stop().css("border-color","#ccc");
	})
	//hotitems
	$(".hotlunbo-right dl").hover(function(){
		$(this).find("dt").stop().animate({"left":"16%"},200)
		$(this).find("dd").stop().animate({"left":"29%"},200)
	},function(){
		$(this).find("dt").stop().animate({"left":"10%"},200)
		$(this).find("dd").stop().animate({"left":"35%"},200)
	})
	//hotitems
	$(".hotitems-main-title li").mouseover(function(){
		
		$(this).css("background","#000000").siblings().css("background","#999999")
		$(".hotitems-main-lunbo ul li").removeClass().addClass("hide");
		$(".hotitems-main-lunbo ul li").eq($(this).index()).removeClass().addClass("active");
			
	})
	//main-title
	$(".main-title-ul li").hover(function(){
		$(this).find(".main-cover-top").stop().animate({"height":"15px"},200)
	},function(){
		$(this).find(".main-cover-top").stop().animate({"height":"50px"},200)
	})
	// main-right小轮播
	 var mySwiper = new Swiper ('.classicbags-lunbo', {
    direction: 'horizontal',
    autoplay : 3000,
    grabCursor : true,
    loop: true,
    pagination : '.swiper-pagination',
    paginationClickable :true,
   	autoplayDisableOnInteraction: false,
    // 如果需要分页器
    pagination: '.swiper-pagination',
    
    // 如果需要前进后退按钮
    nextButton: '.swiper-button-next',
    prevButton: '.swiper-button-prev',
  })  
    //body-right
    $(".body-right ul li").hover(function(){
    	$(this).css("background","#c8a985")
    	$(this).find(".body-right-logo").css("display","block")
    	$(this).find("div:eq(0)").css("background-position-y","-122px")
    },function(){
    	$(this).css("background","#000000")
    	$(this).find(".body-right-logo").css("display","none")
    	$(this).find("div:eq(0)").css("background-position-y","-157px")
    })
  	$(".return-top").click(function(){
  		$('body,html').animate({ scrollTop: 0 }, 200);
        return false;
  	})
  	$(".body-right ul li").mouseover(function(){
  		return false;
  	})
    
    $person = $(".top-right a")
    console.log($person.eq(0).html())
    var users = getCookie("txt") ? getCookie("txt") : "";
    console.log(users);
    if(users){
    	$person.eq(0).html("欢迎"+users+"用户")
    	$person.eq(0).attr("href","##")
    	$person.eq(1).html("退出")
    	$person.eq(1).attr("href","##")
    	$person.eq(1).click(function(){
    		removeCookie("txt");
    		location.href="index.html"
    	})
    }else{
    	$person.eq(0).html("登录")
    	$person.eq(0).attr("href","html/enter.html")
    	$person.eq(1).html("注册")
    	$person.eq(1).attr("href","html/register.html")
    }
    //购物车小图标跳转cart.html
    $(".top-bottom-right").click(function(){
		location.href= "html/cart.html"
	})
    var num = getCookie("num") ? getCookie("num") : 0;
   $(".cart-num").html(num)
  
  
  
  
  
  
  
	})
})
